package cn.gzsxt.music.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.gzsxt.music.mapper.HitSongMapper;
import cn.gzsxt.music.query.HitSongQueryObject;
import cn.gzsxt.music.service.HitSongService;

@Service
public class HitSongServiceImpl implements HitSongService{

	@Autowired
	private HitSongMapper mapper;
		
	@Override
	public Map<String, Object> selectSongByCondition(HitSongQueryObject qo) {
		Map<String,Object> datagirdMap = new HashMap<>();
		//查询总数
		datagirdMap.put("total", mapper.selectHitSongTotalByCondition(qo));
		//查询结果集
		datagirdMap.put("rows", mapper.selectHitSongListByCondition(qo));
		
		return datagirdMap;
	}

	//保存热门歌曲
	@Override
	public int updateHitSong(Map<String, Object> params) {
		
		return mapper.updateHitSong(params);
	}

}
